#!/bin/bash

AST_INT=../build/ast-interpreter
CC=/usr/bin/gcc
BUILTIN_DEF=./builtinf.c
OUT_DIR=../temp

if [ $# -ne 1 ]; then
	echo "Usage: $0 <test-number>"
	exit 1
fi

TESTSAMPLE=./test$1.c
EXE_FILE=$OUT_DIR/exe_test$1
echo "Running test sample using GCC: $TESTSAMPLE"
$CC $TESTSAMPLE $BUILTIN_DEF -o $EXE_FILE
$EXE_FILE
echo -e "\nRunning test sample using AST Interpreter: $TESTSAMPLE"
$AST_INT $TESTSAMPLE
